home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Alles Voor Internet / Tout Pour Internet
/
alles voor internet.iso
/
MacInternet™
/
Telnet
/
NCSA
/
tn3270 2.3d26 source
/
tn3270
/
switcher.c
< prev
next >
Wrap
Text File
|
1991-05-24
|
4KB
|
141 lines
/*
* tn3270 for the Macintosh Source Code
* Brown University Computing and Information Services
* Version 2.3d21, January 17, 1991
* Copyright (c) 1988, 1989, 1990, 1991 by Brown University and by
* Peter John DiCamillo.
*
* Permission is granted to any individual or institution to use, copy,
* or redistribute the binary version of this software and its
* documentation provided this notice and the copyright notices are
* retained. Permission is granted to any individual or non-profit
* institution to use, copy, modify, or redistribute the source files
* of this software provided this notice and the copyright notices are
* retained. This software may not be distributed for profit, either
* in original form or in derivative works, nor can the source be
* distributed to other than an individual or a non-profit institution.
* Any individual or group interested in seeing and/or using these
* source files but who are prevented from doing so by the above
* constraints should contact Don Wolfe, Assistant Vice-President for
* Computer Systems at Brown University, (401) 863-7250, for possible
* software licensing of the source developed at Brown.
*
* Brown University and Peter John DiCamillo make no representations
* about the suitability of this software for any purpose.
*
* BROWN UNIVERSITY AND PETER JOHN DICAMILLO GIVE NO WARRANTY, EITHER
* EXPRESS OR IMPLIED, FOR THE PROGRAM AND/OR DOCUMENTATION PROVIDED,
* INCLUDING, WITHOUT LIMITATION, WARRANTY OF MERCHANTABILITY AND
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE.
*
*/
#include "maclib.h"
#include "termdef.h"
#include "globals.h"
typedef struct WorldTable {
char * WTPCBPtr;
short WTFlags;
ProcPtr WTBgtask;
Handle WTScrbits;
WindowPtr WTDeskAcc;
} WorldTable;
extern bgproc(); /* assembler routine to get background calls */
extern char xdlg;
extern DialogPtr xdlgptr;
extern PaletteHandle myPalette;
sw_suspend(message)
long message;
{
WorldTable * wt, * get_world();
if (!sw_active()) { /* MultiFinder suspend event */
mf_bgrnd = 1;
exportscrap(0);
if (myWindow != 0) justGrowIcon(0);
if (xdlg) xfGrowIcon();
dfltcurs = 1;
SetCursor(&qd.arrow);
return;
}
if (message & 0x00000020) /* convert private to desk scrap if needed */
exportscrap(0);
sw_bgrnd = 1; /* indicate backgound mode pending */
sw_upd = 0; /* reset update flag */
sw_beep = 0; /* reset beep flag */
wt = get_world(); /* install background routine */
wt->WTBgtask = (ProcPtr)bgproc;
}
sw_resume(message)
long message;
{
WorldTable * wt, * get_world();
if (message & 0x00000020) importscrap();
dfltcurs = 1;
SetCursor(&qd.arrow);
if (mf_bgrnd == 1) {
if (xdlg) {
SelectWindow(xdlgptr);
xfGrowIcon();
}
mf_bgrnd = 0;
if (myWindow != 0) {
if (colormac) {
ActivatePalette(myWindow);
updCTab();
newbackcolor();
}
justGrowIcon(0);
invldscr();
cs.stat_time += 8; /* force time to be re-drawn */
newstat();
chkpx();
}
}
if (sw_bgrnd == 0) return;
sw_bgrnd = 0; /* indcate no longer in background */
wt = get_world(); /* de-install background routine */
wt->WTBgtask = 0;
if (sw_upd) { /* update for changes during background */
if (xdlg) xfGrowIcon();
if (myWindow != 0) {
justGrowIcon(0);
invldscr();
newstat();
chkpx();
}
}
if (sw_beep) beep();
}
sw_active() /* tell caller if we're under Switcher */
{
static long * sw_globals = (long *)0x282;
if ((*sw_globals) == 0) return(0);
if ((*sw_globals) == -1) return(0);
return(1);
}
WorldTable * get_world()
{
static unsigned long * ApplZone = (unsigned long *)0x2aa;
return((WorldTable *)((*ApplZone) - 18));
}
sw_proc() /* called as background process */
{
if (serflg) hndser();
else if (tcpflg) tcpevent();
else if (netconn) getreq();
}